﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace CoD4_Helper.Utils
{
    /// <summary>
    /// It represents a CoD4 config command
    /// </summary>
    sealed class CfgCommand : INotifyPropertyChanged
    {
        private string _command;
        private string _value;
        private string _type;

        public CfgCommand(string command, string value, string type)
        {
            _command = command;
            _value = value;
            _type = type;
        }

        public string Command
        {
            get { return _command; }
            set
            {
                _command = value;
                this.NotifyPropertyChanged("Command");
            }
        }

        public string Value
        {
            get { return _value; }
            set
            {
                _value = value;
                this.NotifyPropertyChanged("Value");
            }
        }

        public string Type
        {
            get { return _type; }
            set
            {
                _type = value;
                this.NotifyPropertyChanged("Type");
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged(string name)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(name));
        }

    }
}
